﻿@model Citi.Scheduler.WebUi.Models.UserModel
<script type="text/javascript">
    function closeDialogUser() {
        $('#divUpdateUser').modal('toggle');
        $('.modal').toggle();
        clearForm();
    }

    function clearForm() {
        $("#formActionForm").trigger('reset');
    }
</script>
@using (Ajax.BeginForm("ActionForm", "User", new AjaxOptions
{
    UpdateTargetId = "divIndexUser",
    InsertionMode = InsertionMode.Replace,
    OnComplete = "closeDialogUser"
}, new { id = "formActionForm" }))
{
    @Html.ValidationSummary(true)
@*<fieldset>
        <legend>UserModel</legend>
        *@
    if (Model != null)
    {
    @Html.HiddenFor(model => model.Id)
    }

    <div class="editor-label">
        @Html.LabelFor(model => model.Name)
    </div>
    <div class="editor-field">
        @Html.TextBoxFor(model => model.Name, new { maxlength = 100 })
        @Html.ValidationMessageFor(model => model.Name)
    </div>

    <div class="editor-label">
        @Html.LabelFor(model => model.Soeid)
    </div>
    <div class="editor-field">
        @Html.TextBoxFor(model => model.Soeid, new { maxlength = 7 })
        @Html.ValidationMessageFor(model => model.Soeid)
    </div>
    
    <div class="editor-label">
        @Html.LabelFor(model => model.Manager)
    </div>
    <div class="editor-field">
        @Html.DropDownListFor(model => model.ManagerId, (SelectList)ViewBag.Managers)
        @Html.ValidationMessageFor(model => model.ManagerId)
    </div>

    <p>
        <input type="submit" value="Save" class="hide" id="submitUser" />
    </p>
@* </fieldset>*@
}
